﻿using System;
using Dsl.Ped.Common.Converters;
using NUnit.Framework;

namespace DSLPedCommonTest.Converters
{
    [TestFixture]
    public class NullToBoolConverterTest
    {
        private NullToBoolConverter converter;

        [SetUp]
        public void SetUpForEachTest()
        {
            converter = new NullToBoolConverter();
        }

        [Test, Description("Convert null to false")]
        public void NegatedBoolConverterWithoutParameterTest()
        {
            var obj = converter.Convert(null, typeof(bool), null, null);
            Assert.AreEqual(false, (bool)obj);
        }

        [Test, Description("Convert not null to true")]
        public void NegatedBoolConverterWithParameterTest()
        {
            object someObject = new Int32();

            var obj = converter.Convert(someObject, typeof(bool), null, null);
            Assert.AreEqual(true, (bool)obj);
        }
    }
}
